package com.wenlin.myproduction.bean;

import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;

public class ProductBean implements Parcelable {
    private String name;
    private View.OnClickListener clickListener;

    public ProductBean(String name, View.OnClickListener clickListener) {
        this.name = name;
        this.clickListener = clickListener;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public View.OnClickListener getClickListener() {
        return clickListener;
    }

    public void setClickListener(View.OnClickListener clickListener) {
        this.clickListener = clickListener;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
    }

    protected ProductBean(Parcel in) {
        this.name = in.readString();
        this.clickListener = in.readParcelable(View.OnClickListener.class.getClassLoader());
    }

    public static final Creator<ProductBean> CREATOR = new Creator<ProductBean>() {
        @Override
        public ProductBean createFromParcel(Parcel source) {
            return new ProductBean(source);
        }

        @Override
        public ProductBean[] newArray(int size) {
            return new ProductBean[size];
        }
    };
}
